package cn.larry.aop.service;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import cn.larry.aop.domain.User;

@Service
public class UserService {
	private static Logger logger=LoggerFactory.getLogger(UserService.class);

	public User findById(int id) {
		logger.info("public User findById(int id)");
		return new User(id);
	}

	public User findByName(String name) {
		logger.info("public User findByName(String name)");
		return new User(name,0);
	}
	
	public List<User> findByIds(int[] ids){
		logger.info("public List<User> findByIds(int[] ids)");
		List<User> list=new ArrayList<>();
		for (int id : ids) {
			list.add(new User(id));
		}
		return list;
	}

}
